package com.tianqu.tms.dao;

import java.util.List;
import com.tianqu.tms.core.exception.TmsDaoException;
import com.tianqu.tms.dto.RentalInfoDto;

public interface RentalContractDao {
	/**
	 * 插入合同信息
	 * @return
	 * @throws TmsDaoException
	 */
	public void insertContractInfo(RentalInfoDto dto)throws TmsDaoException;
	/**
	 * 更新合同信息
	 * @return
	 * @throws TmsDaoException
	 */
	public void updateContractInfo(RentalInfoDto dto)throws TmsDaoException;
	/**
	 * 更新合同状态
	 * @return
	 * @throws TmsDaoException
	 */
	public void updateContractStatus(RentalInfoDto dto)throws TmsDaoException;
	/**
	 * 判断合同编号是否存在
	 * @return
	 * @throws TmsDaoException
	 */
	public boolean isExistRentalLocationBySerial(String serial)throws TmsDaoException;
	/**
	 * 判断租位是否被使用
	 * @return
	 * @throws TmsDaoException
	 */
	public boolean checkLocationSerialUsed(String serial,String locationSerial)throws TmsDaoException;
	/**
	 * 查询合同状态
	 * @return
	 * @throws TmsDaoException
	 */
	public int searchStatusById(long id)throws TmsDaoException;
	/**
	 * 合同信息查询
	 * @return
	 * @throws TmsDaoException
	 */
	public List<RentalInfoDto> searchRentalContractInfo(String serial,String locationSerial,String ownerName,
			String status,String startDateS,String startDateE,String endDateS,String endDateE,int rentalArea) throws TmsDaoException;
	
	/**
	 * 合同信息操作记录查询
	 * @return
	 * @throws TmsDaoException
	 */
	public List<RentalInfoDto> searchRentalContractUpdateHistroy(String serial,String handleName,
			String handleType,String handleDateS,String handleDateE) throws TmsDaoException;
	
	/**
	 * 合同详细信息查询
	 * @return
	 * @throws TmsDaoException
	 */
	public RentalInfoDto searchRentalContractDetailInfo(long id) throws TmsDaoException;
	
	/**
	 * 合同详细信息查询
	 * @return
	 * @throws TmsDaoException
	 */
	public RentalInfoDto searchRentalContractDetailInfoBySerial(String serial) throws TmsDaoException;
	
	/**
	 * 合同详细信息查询
	 * @return
	 * @throws TmsDaoException
	 */
	public List<RentalInfoDto> searchRentalContractInfoByLocationSerial(String serial) throws TmsDaoException;
	
	/**
	 * 模糊查询合同编号列表
	 * @return
	 * @throws TmsDaoException
	 */
	public List<RentalInfoDto> findSerialList(String serial)throws TmsDaoException;
	
	/**
	 * 模糊查询合同编号列表
	 * @return
	 * @throws TmsDaoException
	 */
	public List<RentalInfoDto> findSerialInfoList(String serial)throws TmsDaoException;
	
	/**
	 * 模糊查询合同人姓名列表
	 * @return
	 * @throws TmsDaoException
	 */
	public List<RentalInfoDto> findOwnerNameList(String ownerName)throws TmsDaoException;
	
	/**
	 * 模糊查询操作人姓名列表
	 * @return
	 * @throws TmsDaoException
	 */
	public List<RentalInfoDto> findHandleNameList(String realName)throws TmsDaoException;
	
	/**
	 * 合同租位信息查询
	 * @return
	 * @throws TmsDaoException
	 */
	public RentalInfoDto findContractInfoBySerial(String serial)throws TmsDaoException;
	
	/**
	 * 同一个租位的租期是否重叠check
	 * @return
	 * @throws TmsDaoException
	 */
	public List<RentalInfoDto> checkLocationStartDate(String locationSerial)throws TmsDaoException;
	
	
	/**
	 * 插入 租赁合同操作记录表
	 * @return
	 * @throws TmsDaoException
	 */
	public void insertContractUpdateHistroy(RentalInfoDto dto)throws TmsDaoException;
}
